package common.test;

public class SingleNumber {

    public int singleNumber(int[] nums) {
        if (nums == null || nums.length == 0) {
            return 0;
        }
        int k = 0;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] == nums[i] || nums[i] == 0) {
                nums[i] = 0;
                nums[k] = 0;
                i = k;
                k++;
            }
        }
        return nums[k];
    }
}
